

use "$raw\Block 5_Monthly consumption of food, pan, tobacco and intoxicants", clear
append using "$raw\Block 6_Monthly consumption of fuel & light"
append using "$raw\Block 7_Consumption of clothing"
append using "$raw\Block 8_Consumption of footwear"
append using "$raw\Block 9_Expenditure on education and medical (institutional) goods and services"
append using "$raw\Block 10_Monthly expenditure on miscellaneous goods and services including medical (non-institutional), rents and taxes"
append using "$raw\Block 11_Expenditure for purchase and construction (including repair and maintenance) of durable goods for domestic use"

gen mult_comb=MLT/100 if NSS==NSC
replace mult_comb=MLT/200 if NSS!=NSC

cap gen itemCode=""
cap gen totalConQty30=.
cap gen totalConValue30=.
gen totalConQty365=.
gen totalConValue365=.

forvalues i=5(1)11{
replace itemCode=B`i'_q1 if missing(itemCode)
}
destring itemCode, replace


forvalues i=5(1)6{
replace totalConQty30=B`i'_q5 if missing(totalConQty30)
replace totalConValue30=B`i'_q6 if missing(totalConValue30)
}

forvalues i=7(1)8{
replace totalConQty30=B`i'_q3 if missing(totalConQty30)
replace totalConValue30=B`i'_q4 if missing(totalConValue30)
replace totalConQty365=B`i'_q5 if missing(totalConQty365)
replace totalConValue365=B`i'_q6 if missing(totalConValue365)
}

forvalues i=9(1)9{
replace totalConValue30=B`i'_q3 if missing(totalConValue30)
replace totalConValue365=B`i'_q4 if missing(totalConValue365)
}

forvalues i=10(1)10{
replace totalConValue30=B`i'_q4 if missing(totalConValue30)
}

forvalues i=11(1)11{
replace totalConValue30=B`i'_q7 if missing(totalConValue30)
replace totalConValue365=B`i'_q14 if missing(totalConValue365)
}

merge m:1 HHID using "$data\61st_rnd_HhChar_data_short.dta"
drop _merge

save "$data\61_round_Sch1.dta", replace


